<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>学生管理系统----登录</title>
</head>
    <style>
        form{
            width: 400px;
            height: 400px;
            border: 2px black solid;
            text-align: center;
            margin:auto;
        }
    </style>
<body>
    <%
        Cookie[] cookies =request.getCookies();
        if(cookies!=null){
            for (Cookie cookie:cookies){
                if(cookie.getName().equals("username")){
                    pageContext.setAttribute("username",cookie.getValue());
                }if(cookie.getName().equals("password")){
                    pageContext.setAttribute("password",cookie.getValue());
                }
            }
        }
    %>
    <form action="managerServlet" method="post">
        <input type="hidden" name="flag" value="login"><br>
        <h1>学生管理系统----登录</h1>
        账号：<input type="text" name="username" value="${username}"><br><br>
        密码：<input type="password" name="password" value="${password}"><br><br>
        <input type="checkbox" name="rem" value="Ok" ${empty username?'':'cheecked'}>记住密码<br>
        <input type="submit" value="登录">
    </form>
</body>
</html>
